<?php
session_start();
if (isset($_SESSION['openid']) && isset($_POST['id'])){
    include_once("../c/config.php");
    $mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
    if (!$mysqli->set_charset("utf8")) {printf("Error loading character set utf8: %s\n", $mysqliTwo->error);}
    $openid=$_SESSION['openid'];
    $id=$_POST['id'];
    $query=$mysqli->query("select jid,thecode from ling where openid='".$openid."' and id='".$id."' limit 0,1  ");
    if($query->num_rows>0){
        $getInfo=$query->fetch_assoc();
        $jid=$getInfo['jid'];
        if (!empty($getInfo['thecode'])){
            echo json_encode(array('s'=>'not'));
            exit;
        }
        if (1 == $jid){
            echo json_encode(array('s'=>'2','t'=>'tzj'));
            exit;
        }
        if (4 == $jid){
            echo json_encode(array('s'=>'3','t'=>'yib'));
            exit;
        }
        if (5 == $jid){
            echo json_encode(array('s'=>'3','t'=>'wu'));
            exit;
        }
        
        var_dump($getInfo);
    }else{
        echo json_encode(array('s'=>'not'));
        exit;
    }
    
    
     
}
?>
